//
//  ILCarCollectionTableViewCell.m
//  ILife
//
//  Created by lanou on 15/11/4.
//  Copyright © 2015年 ILife. All rights reserved.
//

#import "ILCarCollectionTableViewCell.h"
#import <UIImageView+WebCache.h>

@implementation ILCarCollectionTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _picIV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 5, SCREEN_WIDTH, SCREEN_WIDTH / 8 * 5)];
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, SCREEN_WIDTH / 8 * 5 - 25, SCREEN_WIDTH, 25)];
        [_picIV addSubview:_titleLabel];
        [self.contentView addSubview:_picIV];
    }
    return self;
}

- (void)setCarModel:(ILCarCollectionModel *)carModel {
    _picIV.backgroundColor = [UIColor lightGrayColor];
    if ([carModel.picUrl isEqualToString:@""]) {
        _picIV.image = [[UIImage imageNamed:@"noPic.jpg"] imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
    } else {
        [_picIV sd_setImageWithURL:[NSURL URLWithString:carModel.picUrl]];
    }
    _titleLabel.textColor = [UIColor whiteColor];
    _titleLabel.backgroundColor = [UIColor colorWithWhite:0.901 alpha:0.16];
    _titleLabel.text = carModel.title;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
